/*
* @Author: K.EL
* @Date:   2020-07-22 16:14:47
* @Last Modified by:   K.EL
* @Last Modified time: 2020-07-30 18:29:45
*/
module.exports={
	handleAvatarSuccess(res, file) {
		if(res.success_code==1){
			this.main_img = res.result;
		}
	},
	beforeAvatarUpload(file) {
		//设置上传参数
		var nowTime =  Math.ceil(new Date().getTime()/1000);
		this.uploadData.appid = this.Common.appid;
		this.uploadData.token = this.Common.cookie('token');
		this.uploadData.time = nowTime;
		this.uploadData.sign = this.Common.md5Enc(nowTime, this);
		// let that = this;
		// that.imgLoading = true;
  //       this.Common.requestUpload('/admin/images/upload',file,function(data){
  //           that.imgLoading = false;
  //       	if(data.success_code==0){
  //       		that.$message({
		// 			title: '警告',
		// 			message: data.message,
		// 			type: 'error'
		// 		});
  //       	}else{
  //       		that.main_img = data.result;
  //       	}
  //       },function(data){
  //           var message = '接口请求失败';
  //       	if(data.message){
  //       		message = data.message;
  //       	}
  //       	that.imgLoading = false;
		// 	that.$message({
		// 		title: '警告',
		// 		message: message,
		// 		type: 'error'
		// 	});
  //       },this);
	}
}